#ifndef ALARMLIGHT_H
#define ALARMLIGHT_H
#include <QWidget>
#include<QPainter>
class AlarmLight :public QWidget
{
    Q_OBJECT
public:
   explicit AlarmLight(QWidget *parent=nullptr);
    AlarmLight(const AlarmLight&) = delete;
        AlarmLight& operator=(const AlarmLight&) = delete;
protected:
        void paintEvent(QPaintEvent*pevent);
        void drawBorderOut(QPainter*painter);
        void drawLight(QPainter*painter);
private:
QColor m_outColorStart;
QColor m_outColorEnd;
QColor m_lightColor;
//接口：更新灯的状态
public slots:
void setBackGroundColor(const QColor&color);
void setRedLight();
void setOrangeLight();
void setYellowLight();
void setGreenLight();
};

#endif // ALARMLIGHT_H
